<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>旅行社系统</title>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <script src="js/api/config.js"></script>
    <script src="js/api/auth.js"></script>
</head>
<body>
    <script>
        // 检查登录状态并重定向
        const userStr = localStorage.getItem(API_CONFIG.USER_KEY);
        console.log('Index page check:', {
            hasUserStr: !!userStr,
            pathname: window.location.pathname
        });

        // 如果是根路径，进行重定向
        if (window.location.pathname === '/' || window.location.pathname === '/index.html') {
            if (!userStr) {
                console.log('Redirecting to login page');
                window.location.href = '/login.html';
            } else {
                console.log('Redirecting to dashboard');
                window.location.href = '/dashboard.html';
            }
        }
    </script>
</body>
</html> 